package com.nidu.demo.log.dto;

import com.nidu.demo.base.BaseTenantCO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 操作日志客户端对象
 *
 * @author auto
 */
@Data
@Schema(description = "操作日志客户端对象")
@EqualsAndHashCode(callSuper = true)
public class OperateLogCO extends BaseTenantCO {

    @Schema(description = "主键ID", example = "1")
    private Long id;

    @Schema(description = "链路追踪编号", example = "trace_123456")
    private String traceId;

    @Schema(description = "用户编号", example = "1")
    private Long userId;

    @Schema(description = "用户类型", example = "1")
    private Integer userType;

    @Schema(description = "操作模块类型", example = "USER")
    private String type;

    @Schema(description = "操作名", example = "创建用户")
    private String subType;

    @Schema(description = "操作数据模块编号", example = "123")
    private Long bizId;

    @Schema(description = "操作内容", example = "创建了用户张三")
    private String action;

    @Schema(description = "操作结果", example = "true")
    private Boolean success;

    @Schema(description = "拓展字段", example = "{\"key\":\"value\"}")
    private String extra;

    @Schema(description = "请求方法名", example = "POST")
    private String requestMethod;

    @Schema(description = "请求地址", example = "/api/user/add")
    private String requestUrl;

    @Schema(description = "用户 IP", example = "192.168.1.1")
    private String userIp;

    @Schema(description = "浏览器 UA", example = "Mozilla/5.0")
    private String userAgent;

}
